import 'package:flutter/material.dart';
void main() {
  runApp(MaterialApp(
    home: Scaffold(
      appBar: AppBar(title: const Text("你好111"),),
      body: Column(
        children: [
          myapp(),
          SizedBox(height: 40,),
          Circular()
        ],
      ),
    ),
  ));
}
class myapp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return  Center(
      child:Container(
        // alignment: Alignment.centerLeft,//与缩放一起用有问题
        margin: const EdgeInsets.fromLTRB(0, 20, 0, 0),
        height: 300,
        width: 300,
        decoration: BoxDecoration(color: Colors.cyan,border:Border.all(color:Colors.redAccent,width: 2)),
        child: Image.network("https://img1.baidu.com/it/u=413643897,2296924942&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500",
          // scale: 4,//图片缩放
          fit: BoxFit.cover,
        ),//表示缩小一倍,
      )
    );
  }
}

//实现一个圆形图片
class Circular extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return Container(
      width: 150,
      height: 150,
      decoration: BoxDecoration(color: Colors.amberAccent,border: Border.all(color: Colors.amber,width: 2)),
    );
  }

}